Package-level declarations

Functions

Link copied to clipboard
inline suspend fun <T> HttpClient.deleteResult(urlString: String, noinline block: HttpRequestBuilder.() -> Unit = {}): Result<T>

Performs an HTTP DELETE request synchronously and returns the result as a Result of type T.

Link copied to clipboard
inline suspend fun <T> HttpClient.deleteResultAsync(urlString: String, noinline block: HttpRequestBuilder.() -> Unit = {}): Deferred<Result<T>>

Executes an asynchronous HTTP DELETE request using the provided URL.

Link copied to clipboard
inline suspend fun <R, T> Result<T>.foldSuspend(crossinline onSuccess: suspend (value: T) -> R, crossinline onFailure: suspend (exception: Throwable) -> R): R

Performs a fold operation on the Result, executing onSuccess if the Result is a success, or onFailure if the Result is a failure.

Link copied to clipboard
actual fun getPlatformName(): String
expect fun getPlatformName(): String
actual fun getPlatformName(): String
actual fun getPlatformName(): String
Link copied to clipboard
inline suspend fun <T> HttpClient.getResult(urlString: String, noinline block: HttpRequestBuilder.() -> Unit = {}): Result<T>

Performs an HTTP GET request synchronously and returns the result as a Result of type T.

Link copied to clipboard
inline suspend fun <T> HttpClient.getResultAsync(urlString: String, noinline block: HttpRequestBuilder.() -> Unit = {}): Deferred<Result<T>>

Executes an asynchronous HTTP GET request using the provided URL.

Link copied to clipboard
inline suspend fun <T> HttpClient.headResult(urlString: String, noinline block: HttpRequestBuilder.() -> Unit = {}): Result<T>

Performs an HTTP HEAD request synchronously and returns the result as a Result of type T.

Link copied to clipboard
inline suspend fun <T> HttpClient.headResultAsync(urlString: String, noinline block: HttpRequestBuilder.() -> Unit = {}): Deferred<Result<T>>

Executes an asynchronous HTTP HEAD request using the provided URL.

Link copied to clipboard
inline suspend fun <R, T> Result<T>.mapSuspend(crossinline transform: suspend (value: T) -> R): Result<R>

Performs a mapping operation on the Result, transforming the value if the Result is a success.

Link copied to clipboard
inline suspend fun <T> Result<T>.onFailureSuspend(crossinline action: suspend (exception: Throwable) -> Unit): Result<T>

Executes a suspend function action if the current result is a failure.

Link copied to clipboard
inline suspend fun <T> Result<T>.onSuccessSuspend(crossinline action: suspend (value: T) -> Unit): Result<T>

Executes a suspend function action if the current result is a success.

Link copied to clipboard
inline suspend fun <T> HttpClient.optionsResult(urlString: String, noinline block: HttpRequestBuilder.() -> Unit = {}): Result<T>

Performs an HTTP OPTIONS request synchronously and returns the result as a Result of type T.

Link copied to clipboard
inline suspend fun <T> HttpClient.optionsResultAsync(urlString: String, noinline block: HttpRequestBuilder.() -> Unit = {}): Deferred<Result<T>>

Executes an asynchronous HTTP OPTIONS request using the provided URL.

Link copied to clipboard
inline suspend fun <T> HttpClient.patchResult(urlString: String, noinline block: HttpRequestBuilder.() -> Unit = {}): Result<T>

Performs an HTTP PATCH request synchronously and returns the result as a Result of type T.

Link copied to clipboard
inline suspend fun <T> HttpClient.patchResultAsync(urlString: String, noinline block: HttpRequestBuilder.() -> Unit = {}): Deferred<Result<T>>

Executes an asynchronous HTTP PATCH request using the provided URL.

Link copied to clipboard
inline suspend fun <T> HttpClient.postResult(urlString: String, noinline block: HttpRequestBuilder.() -> Unit = {}): Result<T>

Performs an HTTP POST request synchronously and returns the result as a Result of type T.

Link copied to clipboard
inline suspend fun <T> HttpClient.postResultAsync(urlString: String, noinline block: HttpRequestBuilder.() -> Unit = {}): Deferred<Result<T>>

Executes an asynchronous HTTP POST request using the provided URL.

Link copied to clipboard
inline suspend fun <T> HttpClient.putResult(urlString: String, noinline block: HttpRequestBuilder.() -> Unit = {}): Result<T>

Performs an HTTP PUT request synchronously and returns the result as a Result of type T.

Link copied to clipboard
inline suspend fun <T> HttpClient.putResultAsync(urlString: String, noinline block: HttpRequestBuilder.() -> Unit = {}): Deferred<Result<T>>

Executes an asynchronous HTTP PUT request using the provided URL.

Link copied to clipboard
inline suspend fun <R, T : R> Result<T>.recoverSuspend(crossinline transform: suspend (exception: Throwable) -> R): Result<R>

Recovers from a failure by executing transform to create a new value if the Result is a failure.

Link copied to clipboard
inline suspend fun <R> runCatchingSuspend(crossinline block: suspend () -> R): Result<R>

Executes a suspend function block within a try-catch and returns the result as a Result.

Link copied to clipboard
inline suspend fun <T, R> T.runCatchingSuspend(crossinline block: suspend T.() -> R): Result<R>

Executes a suspend function block on the receiver T within a try-catch and returns the result as a Result.

Link copied to clipboard
inline suspend fun <R> runSafeSuspendCatching(block: () -> R): Result<R>

Runs a suspending function block safely, catching any exceptions that occur during its execution. Returns a Result indicating success or failure of the function.